//package org.snail.other.controller;
//
//import org.apache.log4j.Logger;
//import org.snail.other.service.impl.ConsumerService;
//import org.snail.other.service.impl.ProducerService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.jms.Destination;
//import javax.jms.JMSException;
//import javax.jms.TextMessage;
//
//@Controller
//public class ActiveDemoController {
//    private static final Logger LOGGER =  Logger.getLogger(ActiveDemoController.class);
//    @Autowired
//    private Destination destination;
//    @Autowired
//    private ProducerService producer;
//    @Autowired
//    private ConsumerService consumer;
//
//    @RequestMapping("onsend")
//    @ResponseBody
//    public void producer(@RequestParam("message") String message){
//        producer.sendMessage(destination,message);
//    }
//
//    @RequestMapping("receive")
//    @ResponseBody
//    public void receive() throws JMSException {
//        TextMessage textMessage = consumer.receive(destination);
//        String msg = textMessage.getText();
//        LOGGER.error("msg:"+msg);
//    }
//}